package com.zbkj.service.service;

import com.github.pagehelper.PageInfo;
import com.zbkj.common.model.shop.EbGroupPurchase;
import com.zbkj.common.request.EbGroupPurchaseRequest;
import com.zbkj.common.response.EbGroupPurchaseResponse;
import com.zbkj.common.response.EbGroupPurchaseStatisticsVo;

import java.util.List;

public interface EbGroupPurchaseService {
    /**
     * 添加商品
     *
     * @param request
     * @return
     */
    public EbGroupPurchase add(EbGroupPurchaseRequest request);

    /**
     * 删除
     */
    public boolean delete(Long id);

    /**
     * 修改商品
     *
     * @param request
     * @return
     */
    public EbGroupPurchase update(EbGroupPurchaseRequest request);

    /**
     * 修改排序
     *
     * @param request
     * @return
     */
    public void updateSortNum(EbGroupPurchaseRequest request);

    /**
     * 修改状态
     *
     * @param request
     */
    public void updateStatus(EbGroupPurchaseRequest request);

    public void updateDel(EbGroupPurchaseRequest request);

    /**
     * 审核
     *
     * @param ebGroupPurchaseRequest
     * @return
     */
    public EbGroupPurchase check(EbGroupPurchaseRequest ebGroupPurchaseRequest);

    /**
     * 商品详情
     *
     * @param id
     * @return
     */
    public EbGroupPurchaseResponse getById(Long id);

    /**
     * 商品列表
     *
     * @param ebGroupPurchaseRequest
     * @return
     */
    public List<EbGroupPurchaseResponse> getList(EbGroupPurchaseRequest ebGroupPurchaseRequest);

    /**
     * 商品分页
     *
     * @param request
     * @return
     */
    public PageInfo<EbGroupPurchaseResponse> getPage(EbGroupPurchaseRequest request);
    public PageInfo<EbGroupPurchaseResponse> getPlatformPage(EbGroupPurchaseRequest request);

    /**
     * 商品统计
     *
     * @param
     * @return
     */
    public EbGroupPurchaseStatisticsVo getShopStatistics(Integer mId);

    /**
     * 添加库存
     * @param ebGroupPurchaseRequest
     */
    void addStock(EbGroupPurchaseRequest ebGroupPurchaseRequest);

    /**
     * 扣减库存
     * @param id
     * @param stock
     */
    void delStock(Integer id, Integer stock);

    /**
     * 去掉订单，库存回库
     * @param id
     * @param stock
     */
    void addOrderStock(Integer id, Integer stock);

    List<EbGroupPurchaseResponse> getShopList(Long id);

    void addSales(Integer productId, Integer payNum);

    /**
     * 更新商品状态
     */
    void setStatusTask();
}
